package com.aigua.order.service.impl;

import com.aigua.exception.OrderNotFoundException;
import com.aigua.order.mapper.OrderMapper;
import com.aigua.order.service.OrderService;
import com.aigua.pojo.Order;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * @TODO:
 * @Author:baimu
 * @Date:2024 03 29 14 53
 **/
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {
    @Override
    public Order findById(Integer id) throws OrderNotFoundException{
        Order order = this.getById(id);
        if(null==order){
            throw new OrderNotFoundException("订单不存在");
        }

        return order;
    }
}
